<template>
  <div v-if="Object.keys(paramInfo).length !== 0" class="detailparaminfo">
    <table class="param-info">
      <tr v-for="tr in paramInfo.tables">
        <td v-for="td in tr">{{ td }}</td>
      </tr>
    </table>
    <table class="info-param">
      <tr v-for="(tr, index) in paramInfo.set">
        <td>{{ tr.key }}</td>
        <td ref="setHeight">{{ tr.value }}</td>
      </tr>
    </table>
  </div>
</template>

<script>
export default {
  name: "DetailParamInfo",
  props: {
    paramInfo: {
      type: Object,
      default: {},
      www: null,
    },
  },
  data() {
    return {
      getheight: [],
      qqq: 0,
    };
  },
  computed: {
    
  },
  created() {
    /* 当文本高度超过45px 使其兄弟元素顶部对齐 */
    setTimeout(() => {
      this.getheight = this.$refs.setHeight;
      for (let i of this.getheight) {
        if (i.offsetHeight > 45) {
          this.www = i.previousElementSibling; //获取当前元素的前一个元素
          this.www.style.cssText = "vertical-align:top";
        }
      }
    }, 500);
  },
  methods: {
    
  },
  components: {},
};
</script>

<style  scoped>
.detailparaminfo {
  padding: 0px 10px;
  font-size: 14px;
  border-bottom: 5px solid #ccc;
}
.param-info,
.info-param {
  width: 100%;
  padding: 10px 0px;
}
.param-info {
  border-bottom: 5px solid #ccc;
}
.param-info tr,
.info-param tr {
  height: 40px;
}
.param-info tr td {
  width: 30px;
  height: 10px;
  vertical-align: top;
}
.info-param tr td:first-child {
  width: 60px;
}
.info-param tr td:last-child {
  color: #eb4868;
}
</style>
